﻿package mortal.game.view.copy.crossMainCity.panels
{
    import com.gengine.global.*;
    import flash.text.*;
    import mortal.common.font.*;
    import mortal.common.global.*;
    import mortal.component.gconst.*;
    import mortal.game.manager.*;
    import mortal.game.view.common.*;
    import mortal.mvc.core.*;

    public class MainCityBattleTips extends View
    {
        private var _sec:SecTimerView;
        private static var _instance:MainCityBattleTips;

        public function MainCityBattleTips()
        {
            this.layer = LayerManager.topLayer;
            return;
        }// end function

        override public function show(param1:int = 0, param2:int = 0) : void
        {
            super.show(param1, param2);
            this.x = Global.stage.stageWidth / 2 - 160;
            this.y = 200;
            return;
        }// end function

        override protected function createDisposedChildrenImpl() : void
        {
            super.createDisposedChildrenImpl();
            var _loc_1:* = GlobalStyle.textFormatPutong;
            _loc_1.size = 26;
            _loc_1.font = FontUtil.xingkaiName;
            this._sec = UIFactory.secTimeView("", 0, 0, 500, 33, this, _loc_1);
            this._sec.filters = [FilterConst.glowFilter];
            this._sec.textColor = 16776960;
            this._sec.timeOutHandler = this.timerOutHandler;
            return;
        }// end function

        private function timerOutHandler() : void
        {
            this._sec.text = "";
            return;
        }// end function

        override protected function disposeImpl(param1:Boolean = true) : void
        {
            super.disposeImpl(param1);
            if (this._sec.running)
            {
                this._sec.stop();
            }
            this._sec.dispose(param1);
            this._sec = null;
            return;
        }// end function

        public function showText(param1:String, param2:int = -1) : void
        {
            if (param2 > 0)
            {
                this._sec.setParse(param1);
            }
            else
            {
                if (this._sec.running)
                {
                    this._sec.stop();
                }
                this._sec.text = param1;
            }
            this._sec.setLeftTime(param2);
            return;
        }// end function

        public static function get instance() : MainCityBattleTips
        {
            if (_instance == null)
            {
                _instance = new MainCityBattleTips;
            }
            return _instance;
        }// end function

        public static function hasShowingInstance() : Boolean
        {
            if (_instance != null && !_instance.isHide)
            {
                return false;
            }
            return true;
        }// end function

    }
}
